using System;
using System.Data;

using Geekees.App.Cashbook.Lib.Entity;
using Geekees.App.Cashbook.Lib.DAL;
using Geekees.App.Cashbook.Lib.Helper;

namespace Geekees.App.Cashbook.Lib.BLL
{
	/// <summary>
	/// Summary description for BLCategory.
	/// </summary>
	public class BLCategory
	{
		public BLCategory()
		{
			
		}

		public static DataTable GetCategoryByClassificationId( int classificationId )
		{
			User u = LoginManager.GetCurrentUser();
			return DACategory.GetCategoryByClassificationId( u.Id, classificationId );
		}

		public static DataTable GetAllCategory( )
		{
			User u = LoginManager.GetCurrentUser();
			return DACategory.GetAllCategory( u.Id );
		}

		public static int AddCategory( string cName, int classificationId )
		{
			User u = LoginManager.GetCurrentUser();
			return DACategory.AddCategory( cName, u.Id, classificationId);
		}

		public static bool UpdateCategory( int cId, string cName, int classificationId )
		{
			User u = LoginManager.GetCurrentUser();
			return DACategory.UpdateCategory( cId, cName, u.Id, classificationId);
		}
		public static bool DeleteCategory( int cId )
		{
			User u = LoginManager.GetCurrentUser();
			return DACategory.DeleteCategory( cId, u.Id );
		}
	}
}
